package com.meng.util;

import org.apache.shiro.crypto.hash.Md5Hash;

public class Md5Util {

    public static void main(String[] args){

     String password1 = new Md5Hash("123456").toString();
     System.out.println("MD5默认加密后："+password1);

     //在password的基础在加密 散列2次
     String password2 = new Md5Hash(password1).toString();
     System.out.println("MD5二次加密后："+password2);


     String pwd = "123456";
     String password3 = new Md5Hash(pwd,"1").toString();
     System.out.println("MD5散列一次加盐后："+password3);

     String password4 = new Md5Hash(pwd,"1",2).toString();
     System.out.println("MD5散列两次加盐后："+password4);

    }
}
